package com.cxhc.system.service.app.impl;

import java.util.List;

import com.cxhc.system.domain.app.Tree;
import com.cxhc.system.mapper.app.TreeMapper;
import com.cxhc.system.service.app.ITreeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 树木Service业务层处理
 *
 * @author Dhq
 * @date 2024-07-31
 */
@Service
public class TreeServiceImpl implements ITreeService {
    @Autowired
    private TreeMapper treeMapper;

    /**
     * 查询树木
     *
     * @param id 树木主键
     * @return 树木
     */
    @Override
    public Tree selectTreeById(Long id) {
        return treeMapper.selectTreeById(id);
    }

    /**
     * 查询树木列表
     *
     * @param tree 树木
     * @return 树木
     */
    @Override
    public List<Tree> selectTreeList(Tree tree) {
        return treeMapper.selectTreeList(tree);
    }

    /**
     * 新增树木
     *
     * @param tree 树木
     * @return 结果
     */
    @Override
    public int insertTree(Tree tree) {
        return treeMapper.insertTree(tree);
    }

    /**
     * 修改树木
     *
     * @param tree 树木
     * @return 结果
     */
    @Override
    public int updateTree(Tree tree) {
        return treeMapper.updateTree(tree);
    }

    /**
     * 批量删除树木
     *
     * @param ids 需要删除的树木主键
     * @return 结果
     */
    @Override
    public int deleteTreeByIds(Long[] ids) {
        return treeMapper.deleteTreeByIds(ids);
    }

    /**
     * 删除树木信息
     *
     * @param id 树木主键
     * @return 结果
     */
    @Override
    public int deleteTreeById(Long id) {
        return treeMapper.deleteTreeById(id);
    }
}
